<?php
use \yii\helpers\Url;
use \yii\helpers\Html;
use \common\models\Catalog;
use \common\models\Post;
use \common\models\Banner;
use \common\models\Links;
use yii\bootstrap\BootstrapAsset;
use yii\web\JqueryAsset;
?><!--post-->
<!--/* @description 产品详情 */-->
<?php
$photos = Banner::photos('首页');
$navItems = Catalog::getNavItems(2);
$alias=Yii::$app->view->params['alias'];
?>
<div  class="banner">
    <div class="hd">
        <ul>
            <?php foreach ($photos as $photo){?>
                <li></li>
            <?php }?>
        </ul>
    </div>
    <div class="bd">
        <ul>
            <?php foreach ($photos as $photo){?>
                <li><a href="<?=$photo['url']?$photo['url']:'#'?>"><img src="<?=$photo['src']?>" /></a></li>
            <?php }?>
        </ul>
    </div>
    <a class="prev" href="javascript:void(0)"></a>
    <a class="next" href="javascript:void(0)"></a>
</div>
<script type="text/javascript">
    jQuery(".banner").slide({mainCell:".bd ul",autoPlay:true,effect:"fold",interTime:"2500"});
</script>
<!--<div class="online_box" style="top:733px;">-->
<!--    <img src="/images/online.png">-->
<!--    <div>-->
<!--        <p><img src="/images/online_contact.png"><span>科牌-小燕</span></p>-->
<!--        <p><img src="/images/online_contact.png"><span>科牌-小燕</span></p>-->
<!--    </div>-->
<!--</div>-->
<div class="content wrapper">

    <div class="content_box">
        <div class="product_display clearfix">
            <div class="pull-left">
                <p>产品展示<br><span>PRODUCT</span></p>
                <ul>
                    <?php
                    for($i=0;$i<count($navItems);$i++){
                        $nav=$navItems[$i];
                        if($nav['name']=='公司简介'){
                            continue;
                        }
                        ?>
                        <li data-url="<?=Url::to(['/catalog','alias'=>$nav['alias']])?>" data-alias="<?=$nav['alias']?>" class="<?=$alias==$nav['alias']?'on':''?>" onclick="ajaxProduct(this,'<?=$nav['alias']?>');"><a href="javascript:"><?=$nav['name']?><span><img src="/images/flag<?=$i+1?>.png"></span></a></li>
                        <?php
                    }
                    ?>
                    <li></li>
                </ul>
            </div>
            <script>
                function ajaxProduct(obj,alias) {
                        window.location.href=$(obj).attr("data-url");
                }
            </script>
            <div class="pull-right">
                <div class="pro_detail">
                    <div class="title clearfix">
                        <p class="pro_tit">产品详情</p>
                        <p>首 页  >  <?=$catalog['name']?>  >  <?=$post['title']?></p>
                    </div>
                    <div class="pro_detail_info_box clearfix">
                        <div class="pro_detail_info">
                            <div class="pro_detail_img">
                                <div class="bd">
                                    <ul>
                                        <?php
                                        if($post['photos']){
                                        foreach(explode('|',$post['photos']) as $photo){
                                        ?>
                                            <li><a target="_blank" href="javascript:;"><img src="<?=$photo?>" /></a></li>
                                        <?php }}?>
                                    </ul>
                                </div>
                                <div class="hd">
                                    <ul>
                                        <?php
                                        if($post['photos']){
                                            foreach(explode('|',$post['photos']) as $photo){
                                                ?>
                                                <li><a target="_blank" href="javascript:;"><img src="<?=$photo?>" /></a></li>
                                            <?php }}?>
                                    </ul>
                                </div>
                            </div>
                            <a class="prev" href="javascript:void(0)"><img src="/images/prev.png"></a>
                            <a class="next" href="javascript:void(0)"><img src="/images/next.png"></a>
                        </div>
                        <div class="pro_content">
                            <p class="tit"><?=$post['title']?></p>
                            <div class="info">
                                <p>商品编号：<?=$attributes['商品编号']?>  </p>
                                <p>颜色：<?=$attributes['颜色']?></p>
                                <p>尺寸1：<?=$attributes['尺寸1']?></p>
                                <p>尺寸2：<?=$attributes['尺寸2']?></p>
                                <p>尺寸3：<?=$attributes['尺寸3']?></p>
                                <p class="pro_word">产品描述：<?=$attributes['产品描述']?></p>
                            </div>
                            <a href="javascript:;"><img src="/images/singal.png">点击咨询</a>
                        </div>
                    </div>
                   <?=$post['content']?>
                </div>
                <script type="text/javascript">
                    jQuery(".pro_detail_info").slide({ mainCell:".bd ul", effect:"fold", delayTime:300,pnLoop:false});
                </script>
            </div>

        </div>
    </div>
</div>